<div ng-if="ctrl.pageReady">
    <datasource-http-settings
        current="ctrl.current"
        suggest-url="https://localhost:8443">
    </datasource-http-settings>

    <div class="gf-form-group">
        <h3 class="page-heading">Bearer token access</h3>

        <div class="gf-form-inline">
            <gf-form-checkbox
                    ng-if="ctrl.version >= 6"
                    class="gf-form"
                    label="Access via token"
                    checked="ctrl.current.jsonData.access_via_token"
                    label-class="width-10"
                    ng-click="ctrl.setUrl()"
                    switch-class="max-width-6">
            </gf-form-checkbox>
            <gf-form-switch
                    ng-if="ctrl.version < 6"
                    class="gf-form"
                    label="Access via token"
                    checked="ctrl.current.jsonData.access_via_token"
                    label-class="width-10"
                    ng-click="ctrl.setUrl()"
                    switch-class="max-width-6">
            </gf-form-switch>
        </div>
        <div class="gf-form-inline" ng-if="ctrl.current.jsonData.access_via_token">
            <div class="gf-form">
                <span class="gf-form-label width-10">Token</span>

                <input type="password" class="gf-form-input width-20" ng-model='ctrl.current.secureJsonData.access_token' placeholder="Token"></input>

            </div>
        </div>
    </div>
    <hr>

    <div class="gf-form-group">
        <h3 class="page-heading">Additional</h3>

        <div class="gf-form-inline">
            <div class="gf-form">
                <span class="gf-form-label width-20">Additional Prometheus datasource</span>
                <select class="gf-form-input"
                        ng-model="ctrl.current.jsonData.prom_name"
                        ng-options="prom.name as prom.name for prom in ctrl.prometheusList"
                ></select>
            </div>
        </div>
        <div class="gf-form-inline">
            <div class="gf-form">
                <span class="gf-form-label width-20">Refresh pods' rate</span>
                <select class="gf-form-input"
                        required
                        ng-model="ctrl.current.jsonData.refresh_pods_rate"
                >
                    <option value="15">15s</option>
                    <option value="30">30s</option>
                    <option value="60">1m</option>
                    <option value="120">2m</option>
                    <option value="300">5m</option>
                </select>
            </div>
        </div>
    </div>
</div>
